#pragma once

// TODO: It will be better to detect the screen size and font size to get
// the value dynamically at first run
// Noock Tian@ 2010-01-20 Changed 128 to 135 to fill all the blank grid of
// 480*800 HTC Touch Pro 2 screen in Chinese
#define ALPHABET_MAX_LEN 140 // to be sure

class CGrpPos
{
protected:
  wchar_t m_groups[ALPHABET_MAX_LEN];
  int    m_pos[ALPHABET_MAX_LEN];
  int    m_count;

public:
  CGrpPos(void);

  void Clean(void);
  int Count() const
  { return m_count; }

  int CalcCount() const;

  int Add(wchar_t grp);
  int Add(wchar_t grp, int pos);

  int GetGrpIndex(wchar_t grp) const;
  int GetGrpPos(wchar_t grp) const;

  wchar_t GetGrpByIndex(int index) const  {return m_groups[index];};
  int    GetPosByIndex(int index)  const  {return m_pos[index];};

  void  SetGrpByIndex(int index, wchar_t grp)  {m_groups[index]=grp;};
  void  SetPosByIndex(int index, int pos)    {m_pos[index]=pos;};
};
